package writtenexamination.bianlifen;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author cyt
 * @create 2020-10-10 下午 8:13
 */
public class Ta {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[] ints = new int[m];
        for (int i = 0; i < m; i++) {
            ints[i++] = i;
        }
        List<List<Integer>> res = new ArrayList<>();
        getAns(ints, m, n, new ArrayList<Integer>(), res, 0);
        System.out.println(res.size());
    }


    public static void getAns(int[] A, int k, int target, List<Integer> list, List<List<Integer>> res, int index) {

        if (target < 0) {
            return;
        }

        if (list.size() == k && target == 0) {
            res.add(new ArrayList<>(list));
            return;
        }

        for (int i = index; i < A.length; i++) {
            if (A[i] > target) {
                break;
            }
            list.add(A[i]);
            getAns(A, k, target - A[i], list, res, i + 1);
            list.remove(list.size() - 1);
        }
    }
}
